package com.yolo.example.consumer;


import com.yolo.example.common.serivce.UserService;
import yolorpc.config.RpcConfig;
import yolorpc.proxy.ServiceProxyFactory;
import yolorpc.utils.ConfigUtils;

/**
 * @author yolo
 * @Program RPC
 * @description 服务消费者
 * @create 2025-04-24 17:27
 **/
public class ConsumerExample {
    public static void main(String[] args) {
        RpcConfig rpcConfig = ConfigUtils.loadConfig(RpcConfig.class, "yolo");
        System.out.println("rpcConfig = " + rpcConfig);

        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        int num = userService.getNum();
        System.out.println("num = " + num);
        int num1 = userService.getNum();
        int num2 = userService.getNum();
        System.out.println("num2 = " + num2);
        System.out.println("num1 = " + num1);
    }
}
